package com.jic.order.api;

import com.jic.common.base.vo.RestResult;
import com.jic.order.rest.request.*;
import com.jic.order.rest.response.CartSettleAddressResponse;
import com.jic.order.rest.response.CartSettleResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.math.BigDecimal;

/**
 * @author: gaolanyu
 * @date: 2020-01-23
 * @remark:
 */
@FeignClient(name = "jic-order", path = "/trade-settle")
public interface SettleFeign {

    @PostMapping(value = "direct-settle")
    public RestResult<CartSettleResponse> directSettle(@RequestBody DirectSettleRequest directSettleRequest);

    @PostMapping(value = "bargain-settle")
    public RestResult<CartSettleResponse> grouponSettle(@RequestBody DirectSettleRequest directSettleRequest);

    @PostMapping(value = "settle")
    public RestResult<CartSettleResponse> settle(@RequestBody CartSettleRequest cartSettleRequest);

    @PostMapping(value = "address")
    public RestResult<CartSettleAddressResponse> address(@RequestBody CartSettleAddressRequest cartSettleAddressRequest);

    @PostMapping(value = "coupon")
    public RestResult<BigDecimal> coupon(@RequestBody CartSettleCouponRequest cartSettleCouponRequest);

    @PostMapping(value = "order")
    public RestResult<String> initOrder(@RequestBody CartOrderRequest cartOrderRequest);
}
